#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

int32_t main(int32_t argc, char *argv[]){
    FILE * f_in = fopen(argv[1], "r");
    char line[64];
    while(fgets(line, 64, f_in)){
        int32_t ans = 0;
        int32_t rounds = 0;
        int32_t times = 0;
        int32_t nxt_times = 0;
        int32_t ball = 0;
        int32_t normal_round = 1;
        int32_t pre = 0;
        for(int32_t i=0;line[i];i++){
            char ch = line[i];
            if(line[i]==' '||line[i]=='\n') continue;
            else if(ch=='X'){
                rounds++;
                pre = 10;
                ans += (normal_round+times)*pre;
                times = rounds<=10?nxt_times + 1:nxt_times;
                nxt_times = rounds<=10?1:0;
                ball = 0;
            }else if(ch=='/'){
                ball++;
                pre = 10-pre;
                ans += (normal_round + times)*pre;
                times = nxt_times + 1;
                nxt_times = 0;
            }else if(ch>='0'&&ch<='9'){
                ball++;
                pre = ch-'0';
                ans += (normal_round + times)*pre;
                times = nxt_times;
                nxt_times = 0;
            }
            if(ball==2){
                ball = 0;
                rounds ++;
            }
            if(rounds>=10){
                normal_round = 0;
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}
